const detectZoom = () => {
    let ratio = 0,
        screen = window.screen,
        ua = navigator.userAgent.toLowerCase();
    if (window.devicePixelRatio !== undefined) {
        ratio = window.devicePixelRatio;
    } else if (~ua.indexOf('msie')) {
        if (screen.deviceXDPI && screen.logicalXDPI) {
            ratio = screen.deviceXDPI / screen.logicalXDPI;
        }
    } else if (
        window.outerWidth !== undefined &&
        window.innerWidth !== undefined
    ) {
        ratio = window.outerWidth / window.innerWidth;
    }
    if (ratio) {
        ratio = Math.round(ratio * 100);
    }
    return ratio;
};

const m = detectZoom()
// console.log(m)
// console.log(window.screen.width)
// console.log(window.devicePixelRatio)
if (window.screen.width <= 1920) {
    document.body.style.zoom = 1
} else {
    if (window.screen.width * window.devicePixelRatio >= 3840) {
        document.body.style.zoom = 100 / (Number(m) / 2)
    } else if (window.screen.width * window.devicePixelRatio >= 2560 && window.screen.width * window.devicePixelRatio < 3840) {
        document.body.style.zoom = 100 / (Number(m) / 1.33)
    } else {
        document.body.style.zoom = 100 / Number(m);
    }
}